
package cc.md888.app.web.controller;


import cc.md888.app.application.feedback.FeedbackService;
import cc.md888.app.application.live.AccountCheckLiveService;
import cc.md888.app.model.feedback.ContactInfoVO;
import cc.md888.app.model.feedback.CreateFeedbackCmd;
import cc.md888.app.model.feedback.FeedbackQuery;
import cc.md888.app.model.feedback.FeedbackVO;
import cc.md888.app.model.live.CheckLiveCmd;
import cc.md888.app.model.live.CheckLiveResultVO;
import cc.md888.dto.PageQuery;
import cc.md888.result.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "用户反馈")
@RestController
@RequestMapping("/api/feedback")
public class FeedbackController
{

    @Autowired
    private FeedbackService feedbackService;

    /**
     * 创建反馈
     * @return
     */
    @PostMapping("/create")
    @ApiOperation("创建反馈")
    public Result<Void> create(@RequestBody CreateFeedbackCmd cmd){
        feedbackService.create(cmd);
        return Result.ok();
    }


    /**
     * 创建反馈
     * @return
     */
    @PostMapping("/listPage")
    @ApiOperation("创建反馈")
    public Result<IPage<FeedbackVO>> listPage(@RequestBody PageQuery<FeedbackQuery> page){
        return Result.ok(
                feedbackService.listPage(page)
        );
    }

    /**
     * 联系方式
     * @return
     */
    @GetMapping("/getContactInfo")
    @ApiOperation("联系方式")
    public Result<List<ContactInfoVO>> getContactInfo(){
        return Result.ok(
                feedbackService.getContactInfo()
        );
    }



}
